﻿
@model List<DataAccess.Models.Alimama>


<div class="row">
    <div class="col-lg-12">
        <div class="main-box">
            <header class="main-box-header clearfix">
                <h2>查询条件</h2>
            </header>
            <div class="main-box-body clearfix">
                <form class="form-inline" role="form">

                    <div class="form-group">
                        <div class="input-group">
                            <span class="input-group-addon"><i class="fa fa-reorder (alias)"></i></span>
                            <input type="text" class="form-control" placeholder="淘宝客订单号" id="OrderID">
                        </div>
                    </div>


                    <div class="form-group">
                        <div class="input-group">
                            <span class="input-group-addon"><i class="fa fa-shopping-cart"></i></span>
                            <input type="text" class="form-control" placeholder="商品编号" id="ProductID">
                        </div>
                    </div>


                    <div class="form-group">
                        <div class="input-group">
                            <span class="input-group-addon"><i class="fa fa-flag"></i></span>
                            <input type="text" class="form-control" placeholder="联盟ID号" id="SourceMediaID">
                        </div>
                    </div>

                    <div class="form-group">
                        <div class="input-group">
                            <span class="input-group-addon"><i class="fa fa-user"></i></span>
                            <input type="text" class="form-control" placeholder="推广者账号" id="AdvName">
                        </div>
                    </div>
                    <button type="button" class="btn btn-s btn-primary" id="search">搜&nbsp;&nbsp;&nbsp;索</button>
                </form>
            </div>
        </div>
    </div>
</div>


<div class="row">
    <div class="col-lg-12">
        <div class="main-box clearfix">
            <header class="main-box-header clearfix">
                <h2>淘宝成交订单查看</h2>
            </header>
            <div class="main-box-body clearfix">
                <div class="table-responsive">
                    <table id="acc_tb" class="table table-hover ">
                        <thead>
                            <tr>
                                <th data-sortable="true" data-formatter="OrderByOder">订单号/商品ID</th>
                                <th data-field="ProductDes" data-sortable="true">商品名称</th>
                                <th data-field="CreateDate" data-sortable="true">时间</th>
                                <th data-sortable="true" data-formatter="OrderByPrice">金额</th>
                                <th data-field="AdvID" data-sortable="true">会员</th>
                                <th data-sortable="true" data-formatter="OrderByUser">账号</th>
                            </tr>
                        </thead>
                    </table>
                </div>
            </div>
        </div>
    </div>
</div>
@section Scripts{
    <link rel="stylesheet" type="text/css" href="/css/libs/dataTables.fixedHeader.css">
    <link rel="stylesheet" type="text/css" href="/css/libs/dataTables.tableTools.css">
    <script src="~/Scripts/plugins/bootstrap.min.js"></script>
    <script src="~/Scripts/plugins/bootstrap-table/bootstrap-table.min.js"></script>
    <script src="~/Scripts/plugins/bootstrap-table/locale/bootstrap-table-zh-CN.min.js"></script>
    <script type="text/javascript" src="~/Scripts/sys/lib/common_raw.js"></script>
    <script src="~/Scripts/plugins/layer/layer.min.js"></script>
    <script type="text/javascript">
        function initAcTable() {
            $('#acc_tb').bootstrapTable('destroy');
            common.initAcTable("acc_tb", "toolbar", "post", "/getTbkOrders.html",
                function (data) {
                    if (!data.State) {
                        common.msg(data.Message, 1);
                    }
                },
                function (e) { },
                true, true, false, 10, 1, "[10,20,30,50]", { OrderID: $("#OrderID").val(), ProductID: $("#ProductID").val(), SourceMediaID: $("#SourceMediaID").val(), AdvName: $("#AdvName").val(), });
        }

        $(document).ready(function () {

            initAcTable();

            $("#search").bind("click", function () {
                var load_index3 = layer.load(0, { shade: 0.6 });
                initAcTable();
                layer.close(load_index3);
            });

        });
        function CreateDate(index, row) {
            var birthdayMilliseconds = parseInt(row.CreateDate.replace(/\/Date\(/igm, ""));
            return new Date(birthdayMilliseconds).Format("yyyy-MM-dd hh:mm:ss");
        }
        function OrderByUser(index, row) {
            return "<span  >" + row.AdvID + "</span><br><span >" + row.AdvName + "</span>";
        }
        function OrderByPrice(index, row) {
            return "<span>消费：" + row.PayPrice + "</span><br><span >佣金：" + row.EffectPrediction + "</span>";
        }
        function OrderByOder(index, row) {
            return "<span>" + row.OrderID + "</span><br><span >" + row.ProductID + "</span>";
        }

    </script>
}




